package com.molichuxing.gateway.api.services;

import com.molichuxing.framework.dto.Paged;
import com.molichuxing.framework.result.ResponseResult;
import com.molichuxing.gateway.bff.car.entity.response.CarsMileageMonitoringEnterpriseVo;
import com.molichuxing.gateway.bff.car.entity.response.CarsMileageWarnEnterpriseVo;
import com.molichuxing.gateway.bff.financial.entity.response.DeliveryVo;
import com.molichuxing.gateway.bff.order.entity.request.create.*;
import com.molichuxing.gateway.bff.order.entity.request.modify.*;
import com.molichuxing.gateway.bff.order.entity.response.*;
import com.molichuxing.gateway.bff.payment.entity.response.OfflineBookyueVo;
import org.springframework.validation.BindingResult;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

/**
 * 订单相关接口
 * 
 * @author zoumingyu
 * @date 2019年8月11日
 *
 */
public interface OrderApiService {

	/**
	 * 获取经销商订单列表
	 * @param params
	 * @param pageNum
	 * @param pageSize
	 * @return
	 */
	public ResponseResult<Paged<OrderDealerVo>> orderDealerList(Map<String, Object> params , Integer pageNum, Integer pageSize);


	/**
	 * 获取采购单信息详情 - 状态流转
	 * @param orderCode
	 * @return
	 */
	public ResponseResult<List<OrderDealerDetailStatusVo>> getDealerOrderFlow(Long orderCode) ;


	/**
	 * 获取采购单信息详情 - 基础信息
	 * @param orderCode
	 * @return
	 */
	public ResponseResult<OrderDealerDetailBasicVo> orderDetailBasic(Long orderCode);


	/**
	 * 获取采购单信息详情 - 采购车辆列表
	 * @param orderCode
	 * @return
	 */
	public ResponseResult<OrderDealerDetailVehicleVo> orderDetailVehicle(Long orderCode);


	/**
	 * 获取采购单信息详情 -获取还款信息列表
	 * @param orderCode
	 * @return
	 */
	public ResponseResult<List<OrderDealerDetailScheduleVo>> orderSchedule(Long orderCode);


	/**
	 * 获取发车收车列表
	 * @param orderCode
	 * @param carStatus
	 * @return
	 */
	public ResponseResult<Paged<OrderDealerDetailStartVo>> orderDealerStartList(Long orderCode ,Integer carStatus);


	/**
	 * 编辑发车
	 * @param orderDealerDispatcherModifyVo
	 * @return
	 */
	public ResponseResult<Boolean> orderDealerSendCar(OrderDealerDispatcherModifyVo orderDealerDispatcherModifyVo);


	/**
	 * 车辆拒收
	 * @param orderCode
	 * @param carId
	 * @param rejectReason
	 * @return
	 */
	public ResponseResult<Boolean> orderDealerCarRefuse(Long orderCode , Integer carId , String rejectReason);


	/**
	 * 更换车架号
	 * @param orderDealerCarChangeVinModifyVo
	 * @return
	 */
	public ResponseResult<Boolean> orderDealerCarChange(OrderDealerCarChangeVinModifyVo orderDealerCarChangeVinModifyVo);


	/**
	 * 保存交车单
	 * @return
	 */
	public ResponseResult<Boolean> modifyDeliverySlip(OrderDeliverySlipModifyVo orderDeliverySlipModifyVo);


    /**
     * 经销商名称模糊查询
     * @param name
     * @return
     */
	public ResponseResult<List<OrderFuzzyQueryVo>>  getDealerListByName(String name);

	/**
	 * 查询存在未还款的订单的经销商模糊查询
	 * @param name
	 * @return
	 */
	public ResponseResult<List<OrderFuzzyQueryVo>>  getDealerRepaymentListByName(String name);


    /**
     * 分子公司名称模糊查询
     * @param name
     * @return
     */
    public ResponseResult<List<OrderFuzzyQueryVo>>  getSubcompanyByName(String name);

    /**
	 * 新增采购单
	 * @param orderDealerCreateVo
	 * @return
	 */
	public ResponseResult<Boolean> orderDealerCreate(OrderDealerCreateVo orderDealerCreateVo);

	/**
	 * 合同编号验重
	 * @param contractCode
	 * @return
	 */
	public ResponseResult<Boolean> contractCodeRepeat(String contractCode);


	/**
	 * 新增采购单-获取车辆信息
	 * @param vehicleId
	 * @param vin
	 * @return
	 */
	public ResponseResult<OrderDealerCarInfoVo> carInfoRepeat(Integer vehicleId ,String vin);


	/**
	 *  获取经销商订单本期还款列表 - 还款计划
	 * @param params
	 * @param pageNum
	 * @param pageSize
	 * @return
	 */
	public ResponseResult<Paged<OrderScheduleCurrentPeriodVo>> getOrderScheduleCurrentPeriodList(Map<String,Object> params, Integer pageNum, Integer pageSize);


	/**
	 * 获取经销商订单逾期未还款列表 - 逾期未还款
	 * @param params
	 * @param pageNum
	 * @param pageSize
	 * @return
	 */
	public ResponseResult<Paged<OrderScheduleOverdueVo>> getOrderScheduleOverdueList(Map<String,Object> params, Integer pageNum, Integer pageSize);


	/**
	 *  获取还款信息详情 - 基础信息
	 * @param orderCode
	 * @return
	 */
	public ResponseResult<OrderDealerDetailBasicInfoVo> getDetailBasic(Long orderCode);



	/**
	 * 获取还款计划详情-还款计划信息
	 * @param orderCode
	 * @return
	 */
	public ResponseResult<List<OrderDealerDetailScheduleVo>> orderSchedulePlan(Long orderCode);


	/**
	 * 获取还款信息详情 - 逾期信息
	 * @param orderCode
	 * @return
	 */
	public ResponseResult<List<OrderDealerDetailScheduleVo>> orderScheduleExpire(Long orderCode);

	/**
	 * 获取订阅里程订单列表信息
	 * 
	 * @param selectParams
	 *            查询参数
	 * @return
	 */
	public ResponseResult<Paged<OrderSubscribeVo>> orderSubscribeList(String listType,
			Map<String, Object> selectParams);

	/**
	 * 获取订阅里程订单交易流程
	 * 
	 * @param orderCode
	 * @return
	 */
	public ResponseResult<List<OrderTradeFlowVo>> orderSubscribeFlow(String listType, Long orderCode);

	/**
	 * 获取订阅里程基础信息
	 * 
	 * @param listType
	 * @param orderCode
	 * @return
	 */
	public ResponseResult<List<OrderSubscribeBaseVo>> orderSubscribeBase(String listType, Long orderCode);

	/**
	 * 获取订阅里程订单服务明细
	 * 
	 * @param orderCode
	 * @return
	 */
	public ResponseResult<OrderUsedCarVo> orderSubscribeServiceDetails(Long orderCode);

	/**
	 * 获取订阅里程订单用车实况
	 * 
	 * @param orderCode
	 * @return
	 */
	public ResponseResult<OrderUsedCarVo> orderSubscribeUsedCar(Long orderCode);

	/**
	 * 获取订单用车实况
	 * 
	 * @param listType
	 * @param orderCode
	 * @return
	 */
	public ResponseResult<OrderUsedCarVo> orderUsedCar(String listType, Long orderCode);

	/**
	 * 获取订阅里程费用交易明细
	 * 
	 * @param listType
	 * @param orderCode
	 * @return
	 */
	public ResponseResult<List<OrderCostDetailsVo>> orderSubscribeCostDetails(String listType, Long orderCode);

	/**
	 * 获取专属里程订单列表信息
	 * 
	 * @param listType
	 * @param selectParams
	 * @return
	 */
	public ResponseResult<Paged<OrderExclusivelVo>> orderExclusivelList(String listType,
			Map<String, Object> selectParams);

	/**
	 * 获取专属里程订单交易流程
	 * 
	 * @param orderCode
	 * @return
	 */
	public ResponseResult<List<OrderTradeFlowVo>> orderExclusivelFlow(String listType, Long orderCode);

	/**
	 * 获取专属里程订单基础信息
	 * 
	 * @param listType
	 * @param orderCode
	 * @return
	 */
	public ResponseResult<OrderExclusivelBaseVo> orderExclusivelBase(String listType, Long orderCode);

	/**
	 * 获取专属里程费用交易明细
	 * 
	 * @param listType
	 * @param orderCode
	 * @return
	 */
	public ResponseResult<List<OrderCostDetailsVo>> orderExclusivelCostDetails(String listType, Long orderCode);

	/**
	 * 获取专属里程还款明细
	 * 
	 * @param listType
	 * @param orderCode
	 * @return
	 */
	public ResponseResult<OrderExclusivelRepaymentDetailVo> orderExclusivelRepaymentDetail(String listType,
			Long orderCode);

	/**
	 * 获取专属里程本期还款计划
	 * 
	 * @param selectParams
	 * @return
	 */
	public ResponseResult<Paged<OrderRepaymentVo>> orderExclusivelCurrentPeriod(Map<String, Object> selectParams);

	/**
	 * 专属里程本期还款计划导出
	 * 
	 * @param response
	 * @param selectParams
	 */
	public void orderExclusivelCurrentPeriodDownload(HttpServletRequest request, HttpServletResponse response,
			Map<String, Object> selectParams);

	/**
	 * 专属里程本期还款计划导出查询
	 * 
	 * @param response
	 * @param selectParams
	 */
	public ResponseResult<Boolean> orderExclusivelCurrentPeriodDownloadQuery(HttpServletRequest request,
			HttpServletResponse response, Map<String, Object> selectParams);

	/**
	 * 获取专属里程订单逾期管理
	 * 
	 * @param selectParams
	 * @return
	 */
	public ResponseResult<Paged<OrderOverdueVo>> orderExclusivelOverdue(Map<String, Object> selectParams);

	/**
	 * 专属里程订单逾期导出
	 * 
	 * @param selectParams
	 * @return
	 */
	public void orderExclusivelOverdueDownload(HttpServletRequest request, HttpServletResponse response,
			Map<String, Object> selectParams);

	/**
	 * 专属里程订单逾期导出查询
	 * 
	 * @param response
	 * @param selectParams
	 */
	public ResponseResult<Boolean> orderExclusivelOverdueDownloadQuery(HttpServletRequest request,
			HttpServletResponse response, Map<String, Object> selectParams);

	/**
	 * 获取订单还款计划列表
	 * 
	 * @param orderCode
	 * @return
	 */
	public ResponseResult<List<OrderRepaymentDetailVo>> orderRepaymentDetail(Long orderCode, Integer overdue);

	/**
	 * 根据用户id获取订单信息
	 * 
	 * @param userId
	 * @return
	 */
	public ResponseResult<List<UserOrderVo>> orderByUser(Integer userId);

	/**
	 * 根据车辆id获取订单信息
	 * 
	 * @param carId
	 * @return
	 */
	public ResponseResult<List<CarOrderVo>> orderByCar(Integer carId);

	/**
	 * 获取订单线下支付列表(经销商支付记录列表)
	 * 
	 * @param selectParams
	 * @return
	 */
	public ResponseResult<Paged<PaymentOfflineVo>> orderPaymentOfflineList(String repayType, Map<String, Object> selectParams);

	/**
	 * 根据线下支付id查询线下支付流水信息
	 * 
	 * @param offlineId
	 *            线下支付id
	 * @return
	 */
	public ResponseResult<PaymentOfflineVo> orderPaymentOfflineFlow(Integer offlineId);

	/**
	 * 根据线下支付id获取订单排期信息
	 * 
	 * @param offlineId
	 *            线下支付id
	 * @return
	 */
	public ResponseResult<List<PaymentOfflineScheduleVo>> orderPaymentOfflineSchedule(String repayType, Integer offlineId);

	/**
	 * 根据线下支付id查询线下支付审核信息
	 * 
	 * @param offlineId
	 *            线下支付id
	 * @return
	 */
	public ResponseResult<PaymentOfflineAuditVo> orderPaymentOfflineAudit(Integer offlineId);

	/**
	 * 线下支付流水编号是否存在
	 * 
	 * @param serialNumber
	 *            流水编号
	 * @return
	 */
	public ResponseResult<Boolean> orderPaymentOfflineSerialNumberExists(String serialNumber);

	/**
	 * 线下支付获取经销商下未所有还款订单
	 * 
	 * @param dealerId
	 *            经销商id
	 * @return
	 */
	public ResponseResult<List<OrderScheduleUnpaidVo>> getOrderScheduleUnpaid(Integer dealerId);

	/**
	 * 经销商订单支付未还款排期
	 * 
	 * @param orderCode
	 *            订单号
	 * @return
	 */
	public ResponseResult<List<OrderScheduleRelationVo>> orderDealerScheduleNoRepay(Long orderCode);

	/**
	 * 用户订单支付未还款排期
	 * 
	 * @param orderCode
	 * @return
	 */
	public ResponseResult<List<OrderRepaymentDetailVo>> orderUserScheduleNoRepay(String orderCode);

	/**
	 * 新增订单线下支付
	 * 
	 * @param offlineBizCreateVo
	 * @param bindingResult
	 * @return
	 */
	public ResponseResult<Boolean> createOrderPaymentOffline(PaymentOfflineCreateVo createVo,
			BindingResult bindingResult);

	/**
	 * 根据订单号查询合同/单据信息
	 * 
	 * @param orderCode
	 *            订单号
	 * @return
	 */
	public ResponseResult<List<OrderContractVo>> orderContract(String documentType, Long orderCode);

	/**
	 * 根据订单号查询合同单据信息
	 * 
	 * @param orderCode
	 *            订单号
	 * @return
	 */
	public ResponseResult<List<OrderContractVo>> orderContractDocuments(Long orderCode);

	/**
	 * 订单审核
	 * 
	 * @param modifyVo
	 * @return
	 */
	public ResponseResult<Boolean> orderAudit(OrderTradeAuditModifyVo modifyVo, BindingResult bindingResult);

	/**
	 * 查询订单审核信息
	 * 
	 * @param orderCode
	 * @return
	 */
	public ResponseResult<OrderAuditVo> getOrderAudit(Long orderCode);

	/**
	 * 订单交易退款
	 * 
	 * @param modifyVo
	 * @return
	 */
	public ResponseResult<Boolean> orderTradeRefund(OrderTradeRefundModifyVo modifyVo, BindingResult bindingResult);

	/**
	 * 查询订单交易退款信息
	 * 
	 * @param orderCode
	 * @return
	 */
	public ResponseResult<OrderTradeRefundVo> getOrderTradeRefund(Long orderCode);

	/**
	 * 订单征信审核
	 * 
	 * @param modifyVo
	 * @return
	 */
	public ResponseResult<Boolean> orderCreditAudit(OrderCreditAuditModifyVo modifyVo, BindingResult bindingResult);

	/**
	 * 查询订单征信审核信息
	 * 
	 * @param orderCode
	 * @return
	 */
	public ResponseResult<OrderAuditVo> getOrderCreditAudit(Long orderCode);

	/**
	 * 专属订单-订悦订单首付
	 * 
	 * @param modifyVo
	 * @param bindingResult
	 * @return
	 */
	public ResponseResult<Boolean> orderOfflineDownPay(OrderOfflineDownPayModifyVo modifyVo,
			BindingResult bindingResult);

	/**
	 * 专属订单-订悦订单提车
	 * 
	 * @param modifyVo
	 * @param bindingResult
	 * @return
	 */
	public ResponseResult<Boolean> orderOfflineDelivery(OrderOfflineDeliveryModifyVo modifyVo,
			BindingResult bindingResult);

	/**
	 * 同意退租
	 *
	 * @param orderRenegeCreateVo
	 * @return
	 */
	public ResponseResult<Boolean> createOrderRenege(OrderRenegeCreateVo orderRenegeCreateVo, BindingResult bindingResult);

	/**
	 * 取消退租
	 *
	 * @param orderRenegeCancelModifyVo
	 * @return
	 */
	public ResponseResult<Boolean> modifyOrderCancel(OrderRenegeCancelModifyVo orderRenegeCancelModifyVo);

	/**
	 * 发起收/付款
	 *
	 * @param orderRenegeCostModifyVo
	 * @return
	 */
	public ResponseResult<Boolean> modifyOrderCost(OrderRenegeCostModifyVo orderRenegeCostModifyVo);

	/**
	 * 退款完成
	 *
	 * @param orderRenegeCompleteModifyVo
	 * @return
	 */
	public ResponseResult<Boolean> modifyOrderComplete(OrderRenegeCompleteModifyVo orderRenegeCompleteModifyVo);

	/**
	 * 查询订单退租信息
	 *
	 * @param orderCode
	 * @return
	 */
	public ResponseResult<OrderRenegeVo> getOrderRenege(Long orderCode,Integer userId);


	/**
	 * 根据订单code查询 提车单信息（安鹏）
	 *
	 * @param orderCode
	 * @return
	 */
	ResponseResult<DeliveryVo> getDelivery(Long orderCode);

	/**
	 * 根据订单code查询 费用记录（安鹏）
	 *
	 * @param orderCode
	 * @return
	 */
	ResponseResult<OfflineBookyueVo> getOfflineBookyue(Long orderCode);

	/**
	 * 订单-里程监控-车辆月度里程
	 * @param map
	 * @return
	 */
	ResponseResult<Paged<CarsMileageMonitoringEnterpriseVo>>listCarsMileageMonitoring(Map<String, Object> map,Integer pageNum, Integer pageSize);

	/**
	 * 订单-里程监控-超程报警列表
	 * @param map
	 * @return
	 */
	ResponseResult<Paged<CarsMileageWarnEnterpriseVo>>listCarsMileageWarnEnterprise(Map<String, Object> map,Integer pageNum, Integer pageSize);
	/**
	 * 订单-里程监控-超程报警处理
	 * @param map
	 * @return
	 */
	ResponseResult updateCarsMileageWarnEnterprise(Map<String, Object> map);

	/**
	 * 订单-里程监控-超程报警处理-详情
	 *
	 * @param map
	 * @return
	 */
	ResponseResult getCarsMileageWarnEnterprise(Map<String, Object> map);

	/**
	 * 订单协商退租列表
	 *
	 * @param selectParams
	 * @param pageNum
	 * @param pageSize
	 * @return
	 */
	ResponseResult<Paged<OrderNegotiateRenegeVo>> getNegotiateRenegeList(Map<String, Object> selectParams,
	                                                                     Integer pageNum, Integer pageSize);

	/**
	 * 法务诉讼列表
	 *
	 * @param selectParams
	 * @param pageNum
	 * @param pageSize
	 * @return
	 */
	ResponseResult<Paged<OrderLawsuitVo>> getLawsuitList(Map<String, Object> selectParams,
	                                                             Integer pageNum, Integer pageSize);

	/**
	 * 协商退租
	 *
	 * @param createVo
	 * @param bindingResult
	 * @return
	 */
	public ResponseResult<Boolean> createNegotiateRenege(OrderRenegeCreateVo createVo,
	                                                     BindingResult bindingResult);

	/**
	 * 法务诉讼
	 *
	 * @param createVo
	 * @param bindingResult
	 * @return
	 */
	ResponseResult<Boolean> createLawsuit(OrderLawsuitCreateVo createVo,
	                                      BindingResult bindingResult);

	/**
	 * 完成诉讼
	 *
	 * @param modifyVo
	 * @param bindingResult
	 * @return
	 */
	ResponseResult<Boolean> modifyLawsuitComplete(OrderLawsuitModifyVo modifyVo,
	                                              BindingResult bindingResult);

	/**
	 * 订单确认收车
	 *
	 * @param createVo
	 * @param bindingResult
	 * @return
	 */
	ResponseResult<Boolean> createRecycleCars(OrderRecycleCarsCreateVo createVo,
	                                          BindingResult bindingResult);

	/**
	 * 退租完成
	 *
	 * @param modifyVo
	 * @return
	 */
	public ResponseResult<Boolean> modifyRenegeFinish(OrderRenegeCompleteModifyVo modifyVo,
	                                                  BindingResult bindingResult);
}
